﻿
<div class="easyui-tabs" data-options="fit:true,border:false,plain:true" >
    <div title="导航菜单" style="padding:10px;overflow-y:scroll;overflow-x:hidden;" >
        <ul id="tt" class="easyui-tree" data-options="animate:true,lines:true,checkbox:false"></ul>
    </div>    
</div>
<script>
    $(function () {

        $('#tt').tree({
            url: 'Home/GetLeft?v='+ Math.random(),
            @*data: '@ViewBag.MenuList',*@
            onClick: function (node) {
                node.attributes && gotoUrl(node.text, node.attributes.url, node.attributes.id);
            },
            onLoadSuccess: function () {
                 @*$("#tt").tree("collapseAll");*@
            }
        });
    });

    function gotoUrl(name, url, AdminMenuId) {
        if (url.length != 0) {
            //url = '..' + url;
            var index = url.indexOf(".do");
            if (index > 0) {
                url = url.substring(0, index) + url.substring(index + 3) + "&rnd=" + Math.random();
            }
            else {
                url += "?rnd=" + Math.random();
            }
        }
        utils.TabAdd("tabContainer"
                        , name
                        , ''
                        , url
                        );
        
    }
</script>
